Skip to content

feat(linux): add content_fixed overlay layer for positioned child webviews (#10420)#1232

Open
ds1 wants to merge 1 commit into
tauri-apps:devfrom
ds1:fix/linux-multiwebview-content-fixed
Open

feat(linux): add content_fixed overlay layer for positioned child webviews (#10420)#1232
ds1 wants to merge 1 commit into
tauri-apps:devfrom
ds1:fix/linux-multiwebview-content-fixed

Conversation

@ds1

@ds1 ds1 commented Jun 3, 2026

Copy link
Copy Markdown

What

On Linux, add a full-window gtk::Fixed overlay layer to each window — a gtk::Overlay wrapping the default vertical gtk::Box, with the box as the overlay's main child and a pass-through gtk::Fixed as the overlay layer — exposed via WindowExtUnix::content_fixed().

Why

A runtime (e.g. tauri-runtime-wry) can build positioned child webviews into this gtk::Fixed so they overlay the window and honor their bounds, instead of being packed into the vertical gtk::Box, where GTK divides the window height among co-equal children and multi-webview positioning breaks (tauri-apps/tauri#10420). Because the default box stays the overlay's main child and the gtk::Fixed is empty + pass-through for normal windows, single-webview apps are unaffected.

This is the tao half; the tauri-runtime-wry side (build children into content_fixed) and the wry side (position via gtk::Fixed::move_, tauri-apps/wry#1745) complete the fix.

Changes

  • Linux Window: new content_fixed: Option<gtk::Fixed> field; content wrapped in a gtk::Overlay with a pass-through gtk::Fixed overlay layer.
  • WindowExtUnix::content_fixed() -> Option<&gtk::Fixed> accessor.
  • .changes entry (tao: minor).

Testing

Validated in a Tauri v2 app on WSLg (Ubuntu 22.04, WebKitGTK 2.50.4): child webviews built into content_fixed render at and hold their bounds (full-window, multi-tab, resize); a single-webview window is unchanged (the default box fills as before).

The API name/shape is open to your preference — happy to iterate. Full root cause + three-part fix: #10420.

…views

Adds a full-window gtk::Fixed overlay (exposed via WindowExtUnix::content_fixed) so a runtime can position child webviews over the window instead of stacking them in the default vertical gtk::Box. Groundwork for tauri-apps/tauri#10420.

Signed-off-by: ds1 <danmakesthings@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant